package com.weave;

import com.weave.printer.BinaryTrees;
import com.weave.tree.BST;
import com.weave.tree.BinaryTree;

/**
 * @Description 客户端测试
 * @Author weave
 * @Date 2023/10/18 10:55
 */
public class ClientBSTTest {

    public static void main(String[] args) {
        test1();
    }

    static void test1() {
        Integer[] data = new Integer[] {
                7, 4, 9, 2, 5, 8, 11, 3, 12, 1
        };

        BST<Integer> bst = new BST<>();
        for (int i = 0; i < data.length; i++) {
            bst.add(data[i]);
        }

        BinaryTrees.println(bst);

        bst.remove(7);

        BinaryTrees.println(bst);
    }

    static void test2() {
        Integer[] data = new Integer[] {
                // 7, 4
                // 7, 4, 9
                // 7, 4, 9, 5
                // 7, 4, 9, 2
                // 7, 4, 9, 2, 8
                // 7, 4, 9, 2, 1
                7, 4, 9, 2, 1
        };

        BST<Integer> bst = new BST<>();
        for (int i = 0; i < data.length; i++) {
            bst.add(data[i]);
        }

        BinaryTrees.println(bst);
        System.out.println("----------------------------------");
        System.out.println(bst.isComplete());
    }
}
